﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.ServiceProcess;
using System.Text;

namespace SpiderService
{
	public partial class WinService : ServiceBase
	{
		public WinService()
		{
			InitializeComponent();
		}

		protected override void OnStart(string[] args)
		{
			Globals.ServiceLog.WriteInfo("开始启动服务...");
			try
			{
				Globals.Init();
				Globals.ServiceLog.WriteInfo("成功启动服务...");
			}
			catch (Exception ex)
			{
				Globals.ServiceLog.WriteError(ex);
			}
		}

		protected override void OnStop()
		{
			Globals.Shutdown();
		}
	}
}
